﻿<phone:PhoneApplicationPage
    x:Class="WPLottery.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="dtLotteryRow">
            <Border BorderBrush="{Binding RowBrush}" BorderThickness="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="60"/>
                    <ColumnDefinition Width="60"/>
                    <ColumnDefinition Width="60"/>
                    <ColumnDefinition Width="60"/>
                    <ColumnDefinition Width="60"/>
                    <ColumnDefinition Width="60"/>
                    <ColumnDefinition Width="90"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="70"/>
                </Grid.RowDefinitions>
                <Border BorderBrush="Black" Grid.Column="0" BorderThickness="3" Height="70" Width="60">
                    <Border BorderBrush="White" BorderThickness="1" HorizontalAlignment="Center" Height="64" VerticalAlignment="Center" Width="54">
                            <TextBlock Name="N0" Text="{Binding Number0, StringFormat=\{0:D2\}}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40" Foreground="{Binding RowColor}"/>
                    </Border>
                </Border>
                <Border BorderBrush="Black" Grid.Column="1" BorderThickness="3" Height="70" Width="60">
                    <Border BorderBrush="White" BorderThickness="1" HorizontalAlignment="Left" Height="64" VerticalAlignment="Top" Width="54">
                            <TextBlock Name="N1" Text="{Binding Number1, StringFormat=\{0:D2\}}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40" Foreground="{Binding RowColor}"/>
                    </Border>
                </Border>
                <Border BorderBrush="Black" Grid.Column="2" BorderThickness="3" Height="70" Width="60">
                    <Border BorderBrush="White" BorderThickness="1" HorizontalAlignment="Left" Height="64" VerticalAlignment="Top" Width="54">
                            <TextBlock Name="N2" Text="{Binding Number2, StringFormat=\{0:D2\}}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40" Foreground="{Binding RowColor}"/>
                    </Border>
                </Border>
                <Border BorderBrush="Black" Grid.Column="3" BorderThickness="3" Height="70" Width="60">
                    <Border BorderBrush="White" BorderThickness="1" HorizontalAlignment="Left" Height="64" VerticalAlignment="Top" Width="54">
                            <TextBlock Name="N3" Text="{Binding Number3, StringFormat=\{0:D2\}}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40" Foreground="{Binding RowColor}"/>
                    </Border>
                </Border>
                <Border BorderBrush="Black" Grid.Column="4" BorderThickness="3" Height="70" Width="60">
                    <Border BorderBrush="White" BorderThickness="1" HorizontalAlignment="Left" Height="64" VerticalAlignment="Top" Width="54">
                            <TextBlock Name="N4" Text="{Binding Number4, StringFormat=\{0:D2\}}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40" Foreground="{Binding RowColor}"/>
                    </Border>
                </Border>
                <Border BorderBrush="Black" Grid.Column="5" BorderThickness="3" Height="70" Width="60">
                    <Border BorderBrush="Red" BorderThickness="1" HorizontalAlignment="Left" Height="64" VerticalAlignment="Top" Width="54">
                            <TextBlock Name="N5" Text="{Binding Number5, StringFormat=\{0:D2\}}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40" Foreground="{Binding RowColor}"/>
                    </Border>
                </Border>
                <Button FontSize="25" Grid.Column="6" Width="90" Content="X" Tap="Button_Tap_1"></Button>
            </Grid>
            </Border>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- LOCALIZATION NOTE:
            To localize the displayed strings copy their values to appropriately named
            keys in the app's neutral language resource file (AppResources.resx) then
            replace the hard-coded text value between the attributes' quotation marks
            with the binding clause whose path points to that string name.

            For example:

                Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"

            This binding points to the template's string resource named "ApplicationTitle".

            Adding supported languages in the Project Properties tab will create a
            new resx file per language that can carry the translated values of your
            UI strings. The binding in these examples will cause the value of the
            attributes to be drawn from the .resx file that matches the
            CurrentUICulture of the app at run time.
         -->

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="LOTTERY TRACKER" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <StackPanel>
                <phone:LongListSelector IsGroupingEnabled="False" LayoutMode="List" Name="llsNumbers" HorizontalAlignment="Left" Height="500" Margin="0,10,0,0" VerticalAlignment="Top" Width="456" ItemTemplate="{StaticResource dtLotteryRow}" Tap="llsNumbers_Tap"/>
                <Grid x:Name="NewRow" Visibility="Collapsed" VerticalAlignment="Bottom" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>


                    <TextBox Grid.Column="0" x:Name="TestTextBox0"  TextWrapping="Wrap" Text="" InputScope="Number" FontSize="20" BorderThickness="0" MaxLength="2" KeyUp="TestTextBox_KeyUp" />
                    <TextBox Grid.Column="1" x:Name="TestTextBox1"  TextWrapping="Wrap" Text="" InputScope="Number" FontSize="20" BorderThickness="0" MaxLength="2" KeyUp="TestTextBox_KeyUp" />
                    <TextBox Grid.Column="2" x:Name="TestTextBox2"  TextWrapping="Wrap" Text="" InputScope="Number" FontSize="20" BorderThickness="0" MaxLength="2" KeyUp="TestTextBox_KeyUp" />
                    <TextBox Grid.Column="3" x:Name="TestTextBox3"  TextWrapping="Wrap" Text="" InputScope="Number" FontSize="20" BorderThickness="0" MaxLength="2" KeyUp="TestTextBox_KeyUp" />
                    <TextBox Grid.Column="4" x:Name="TestTextBox4"  TextWrapping="Wrap" Text="" InputScope="Number" FontSize="20" BorderThickness="0" MaxLength="2" KeyUp="TestTextBox_KeyUp" />
                    <TextBox Grid.Column="5" x:Name="TestTextBox5"  TextWrapping="Wrap" Text="" InputScope="Number" FontSize="20" BorderThickness="0" Background="#BFD2E60C" Foreground="#FFF50E0E" MaxLength="2"  />

                    <Image Name="Add" Grid.Column="6" Source="/Images/adddark.png" Tap="Add_Tap_1" />
                </Grid>
            </StackPanel>
            <!--<Button Content="Button" HorizontalAlignment="Left" Margin="270,584,0,0" VerticalAlignment="Top" Height="112" Width="186" Click="Button_Click_1"/>-->
            <!--<Button Content="Button" HorizontalAlignment="Left" Margin="48,604,0,0" VerticalAlignment="Top" Width="138" Click="Button_Click_2"/>-->


        </Grid>

        <!--Uncomment to see an alignment grid to help ensure your controls are
            aligned on common boundaries.  The image has a top margin of -32px to
            account for the System Tray. Set this to 0 (or remove the margin altogether)
            if the System Tray is hidden.

            Before shipping remove this XAML and the image itself.-->
        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
    </Grid>

</phone:PhoneApplicationPage>